from rest_framework import serializers
from .models import Area


class AreaInfoSerializer(serializers.ModelSerializer):
    class Meta:
        model = Area
        fields = ('id', 'name')


class AreaSubsInfoSerializer(serializers.ModelSerializer):
    subs = AreaInfoSerializer(read_only=True, many=True)

    class Meta:
        model = Area
        fields = ('id', 'name', 'subs')

